package com.practice.car.cardataapp.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.practice.car.cardataapp.entity.CarPlaceComplaint;
import com.practice.car.cardataapp.entity.frontEnd.Form;
import com.practice.car.cardataapp.mapper.CarPlaceComplaintDao;
import com.practice.car.cardataapp.service.CarPlaceComplaintService;
import com.practice.car.cardataapp.util.R;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Kim
 * @since 2020-09-14
 */
@Service
public class CarPlaceComplaintServiceImpl extends ServiceImpl<CarPlaceComplaintDao, CarPlaceComplaint> implements CarPlaceComplaintService {
    @Override
    public R getChoice(Integer currentpage) {
        Page page = this.page(new Page(currentpage, 20), Wrappers.<CarPlaceComplaint>lambdaQuery().orderByDesc(CarPlaceComplaint::getAmount));
        return R.create().put("tableData",page.getRecords())
                .put("total",page.getTotal());
    }
}
